﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class SysYcjy_user_modify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["sTittle"] = "修改用户信息";

        //MembershipUser u; 获取用户ID
        //u = Membership.GetUser(User.Identity.Name);
        //u.ProviderUserKey.ToString();
        txtusername.Text = HttpContext.Current.User.Identity.Name;
        txtmail.Text = Membership.GetUser().Email;
        txtrole.Text = Roles.GetRolesForUser(HttpContext.Current.User.Identity.Name).ToString();
            
        

    }
    public int ExeSql(string cfenlei1, string cfenlei2, string cfenlei3, string cname, string cjianjie, string cwriter, string claoshi, string cjigou)
    {
        DateTime dxtsj1 = DateTime.Now;
        string Sql = "insert into kecheng (fenlei1,fenlei2,fenlei3,name,jianjie,writer,laoshi,jigou,xtsj1) values ('" + cfenlei1 + "','" + cfenlei2 + "','" + cfenlei3 + "','" + cname + "','" + cjianjie + "','" + cwriter + "','" + claoshi + "','" + cjigou + "','" + dxtsj1 + "')";
        string myConnectionString = ConfigurationSettings.AppSettings["gConnectionString"];
        SqlConnection myConnection = new SqlConnection(myConnectionString);
        SqlCommand myCommand = new SqlCommand(Sql, myConnection);
        try
        {
            myConnection.Open();
            myCommand.ExecuteNonQuery();
            myCommand.Dispose();
            myConnection.Close();
            return 1;
        }
        catch
        {
            myConnection.Close();
            return 0;
        }
    }


    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}
